<template>
  <div>
    <project-manage v-if="level === assistant"></project-manage>
    <project-list v-else></project-list>
  </div>
</template>

<script>
import Cookies from 'js-cookie'
import ProjectManage from './projectManage'
import ProjectList from './projectList'
export default {
  name: 'index',
  data () {
    return {
      level: parseInt(Cookies.get('level')),
      assistant: parseInt(this.assistant)
    }
  },
  components: {
    ProjectManage,
    ProjectList
  },
  methods: {
    judge () {
      if (!Cookies.get('id')) {
        this.$router.push('/loginError')
      }
    }
  },
  created () {
    this.judge()
  }
}
</script>

<style scoped>

</style>
